import execjs
import requests

res = requests.post('https://vip.xiniudata.com/api/vip/web/login/login_by_password', json={
    "payload": {
        "account": "18436276328",
        "password": "hbg123666"
    },
    "v": -20180620
})
with open("./prase/2.犀牛数据.js","r") as f:
    js_str = f.read()
    js_code = execjs.compile(js_str,cwd="./prase")

    payload = {
        "libraryId": 33,
        "sectionId": 208,
        "filterConfigIds": [
            271,
            269,
            270,
            1404,
            889,
            305,
            272,
            266,
            1825,
            267,
            268,
            1162
        ],
        "queryParam": {
            "start": 0,
            "limit": 20,
            "searchFieldIds": None,
            "is_oversea": [
                "1",
                "2",
                "3",
                "4"
            ],
            "query_field_ids": None
        }
    }

json_data = js_code.call("getJsonDate",payload)


res = requests.post("https://vip.xiniudata.com/api/vip/library/v3/init",json=json_data,cookies=res.cookies)


js_data = js_code.call("parse_d",res.json()['d'])
print(js_data)










